﻿using Firearms;
using Sunny.UI;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace VSHT
{
    public partial class videoForm : Form
    {
        private MyLinPhone myPhone;
        internal videoForm()
        {
            InitializeComponent();
           
        }

        private void videoForm_Load(object sender, EventArgs e)
        {
            //pictureBox1.Dock = DockStyle.Fill;
            //this.SizeChanged += videoForm_Resize;
        }

        private void CenterButton()
        {
           

            /* uiAvatar1.Location = new Point((this.ClientSize.Width - uiAvatar1.Width) / 2, this.ClientSize.Height - uiAvatar1.Height - 10);
             uiAvatar2.Location = new Point(100 + (this.ClientSize.Width - uiAvatar2.Width) / 2, this.ClientSize.Height - uiAvatar1.Height - 10);
             uiAvatar3.Location = new Point(200 + (this.ClientSize.Width - uiAvatar3.Width) / 2, this.ClientSize.Height - uiAvatar1.Height - 10);
             uiAvatar4.Location = new Point(300 + (this.ClientSize.Width - uiAvatar4.Width) / 2, this.ClientSize.Height - uiAvatar1.Height - 10);
             uiAvatar5.Location = new Point(400 + (this.ClientSize.Width - uiAvatar5.Width) / 2, this.ClientSize.Height - uiAvatar1.Height - 10);*/
        }
        private void videoForm_Resize(object sender, EventArgs e)
        {
            // 窗体大小改变时，重新居中按钮
            //CenterButton();

        }
        private void pictureBox1_Click(object sender, EventArgs e)
        {

        }

        private bool isDragging = false;
        private Point startPoint;
        private void uiAvatar5_MouseDown(object sender, MouseEventArgs e)
        {
            isDragging = true;
            startPoint = new Point(e.X, e.Y);
        }

        private void uiAvatar5_MouseMove(object sender, MouseEventArgs e)
        {
            if (isDragging)
            {
                Point currentPoint = PointToScreen(new Point(e.X, e.Y));
                Location = new Point(currentPoint.X - startPoint.X, currentPoint.Y - startPoint.Y);
            }
        }

        private void uiAvatar5_MouseUp(object sender, MouseEventArgs e)
        {
            isDragging = false;
        }

        private void uiAvatar4_Click(object sender, EventArgs e)
        {
            CenterButton();
            if (WindowState == FormWindowState.Normal)
            {
                WindowState = FormWindowState.Maximized;
            }
            else
            {
                WindowState = FormWindowState.Normal;
            }
        }

        private void uiAvatar3_Click(object sender, EventArgs e)
        {
            this.WindowState = FormWindowState.Minimized;

        }

        private void uiAvatar1_Click(object sender, EventArgs e)
        {
            Program.MainForm.endCall();

        }

        private void uiAvatar2_Click(object sender, EventArgs e)
        {
            Program.MainForm.acceptCall();
            uiAvatar2.Visible = false;
        }

        private void uiAvatar5_Click(object sender, EventArgs e)
        {

        }
    }
}
